package com.dang.alex.service.Imp;

import com.dang.alex.dao.DAOFactory;
import com.dang.alex.model.User;
import com.dang.alex.service.UserService;

public class UserServiceImp implements UserService{

	@Override
	public void save(User user) throws Exception {
		
		DAOFactory.getUserDAO().sava(user);
		
	}

	@Override
	public User findByEmail(String email) throws Exception {
		
		return DAOFactory.getUserDAO().findByEmail(email);
	}

	@Override
	public User findById(int id) throws Exception {
		
		return DAOFactory.getUserDAO().findById(id);
	}

	@Override
	public void update(User u) throws Exception {

		DAOFactory.getUserDAO().update(u);
		
	}
	
}
